//
//  BQShopPayCell.m
//  BeeQuick
//
//  Created by student on 2017/7/15.
//  Copyright © 2017年 BecomeRich. All rights reserved.
//

#import "BQShopPayCell.h"
#import "BQShopModelArrayManager.h"
@interface BQShopPayCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *payTitleLabel;
@property (weak, nonatomic) IBOutlet UILabel *jingXuanLable;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *numberLable;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;

@property (weak, nonatomic) IBOutlet UILabel *sumPriceLable;
@property (weak, nonatomic) IBOutlet UILabel *headerTopicLabel;
@property (weak, nonatomic) IBOutlet UILabel *redSumPriceLabel;
@property (weak, nonatomic) IBOutlet UIButton *isSuccessButton;

@end

@implementation BQShopPayCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    NSString *sumPrice = [[BQShopModelArrayManager manager] showSumPrice];
    self.redSumPriceLabel.text = [NSString stringWithFormat:@"合计:$%@",sumPrice];
    self.sumPriceLable.text = [NSString stringWithFormat:@"$%@",sumPrice];
}
- (IBAction)buttonAcion:(UIButton *)sender {
    
//    [sender setBackgroundImage:[UIImage imageNamed:@"v2_noselected"] forState:UIControlStateNormal];
    [sender setBackgroundImage:[UIImage imageNamed:@"v2_selected"] forState:UIControlStateHighlighted];
}

- (void)setPayModel:(BQPayModel *)payModel{
    self.iconImageView.image = [UIImage imageNamed:payModel.icon];
    self.payTitleLabel.text = payModel.title;
    
}

- (void)setHeaderModel:(BQPayHeaderTitle *)headerModel{
    self.headerTopicLabel.text = headerModel.topic;
    
}

- (void)setProductModel:(BQProductModel *)productModel{
    self.jingXuanLable.text = @"[精选]";
    self.nameLabel.text = productModel.name;
    self.numberLable.text = [NSString stringWithFormat:@"X%zd",productModel.count];
    self.priceLabel.text = [NSString stringWithFormat:@"$%.2f",productModel.price];
}

@end
